home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / DEM / S-Z / Special Delivery™ Demo.cpt / Special Delivery™ Demo / Claris / Claris Translators / EPSF.rsrc / PS_303 < prev    next >
Text File  |  1991-06-19  |  9KB  |  389 lines

  1. %%BeginProcSet : rampdelta
  2. /rampdelta {
  3. /len 0 3 -1 roll add def
  4. /i2 0 3 -1 roll add def
  5. /i1 0 3 -1 roll add def
  6. /nRampSteps len cellPenW div cvi 1 add dup 512 gt {pop 512} if def
  7. /rampPenW len nRampSteps div def
  8. rampColors i1 get aload pop c1 astore pop
  9. rampColors i2 get aload pop c2 astore pop
  10. c2 0 get c1 0 get sub nRampSteps div d 0 3 -1 roll put
  11. c2 1 get c1 1 get sub nRampSteps div d 1 3 -1 roll put
  12. c2 2 get c1 2 get sub nRampSteps div d 2 3 -1 roll put
  13. d aload pop
  14. } bind def
  15. %%EndProcSet
  16. %%BeginProcSet : adddelta
  17. /adddelta {
  18. d astore pop
  19.  mycurrentrgbcolor c1 copy pop
  20. c1 0 get d 0 get add c2 0 3 -1 roll put
  21. c1 1 get d 1 get add c2 1 3 -1 roll put
  22. c1 2 get d 2 get add c2 2 3 -1 roll put
  23. c2 aload pop setrgbcolor
  24. c2 mycurrentrgbcolor copy pop
  25. } bind def
  26. %%EndProcSet
  27. %%BeginProcSet : rampline
  28. /rampline {
  29. segbox ulx get rampPenW add segbox ulx 3 -1 roll put
  30. segbox llx get rampPenW add segbox llx 3 -1 roll put
  31. segbox ulx get segbox uly get moveto
  32. segbox llx get segbox lly get lineto
  33. delta aload pop adddelta stroke
  34. }bind def
  35. %%EndProcSet
  36. %%BeginProcSet : slantrampseg
  37. /slantrampseg {
  38. gsave newpath
  39. segbox ulx get segbox urx get sub abs
  40. rampdelta delta astore pop
  41. segbox ulx get rampPenW .5 mul sub segbox ulx 3 -1 roll put
  42. segbox llx get rampPenW .5 mul sub segbox llx 3 -1 roll put
  43. rampColors exch get aload mycurrentrgbcolor copy pop setrgbcolor
  44. rampPenW setlinewidth nRampSteps {rampline} repeat
  45. grestore
  46. }bind def
  47. %%EndProcSet
  48. %%BeginProcSet : flipramp
  49. /flipramp {
  50. rampColors 0 get rampColors 3 get rampColors 0 3 -1 roll put rampColors 3 3 -1 roll put
  51. rampColors 1 get rampColors 2 get rampColors 1 3 -1 roll put rampColors 2 3 -1 roll put
  52. } bind def
  53. %%EndProcSet
  54. %%BeginProcSet : leftrbox
  55. /leftrbox {
  56. rbox segbox copy pop    
  57. rbox urx get rbox ulx get sub
  58. flipRatio mul dup 
  59. segbox ulx get add segbox urx 3 -1 roll put
  60. segbox llx get add segbox lrx 3 -1 roll put
  61. } bind def
  62. %%EndProcSet
  63. %%BeginProcSet : rightrbox
  64. /rightrbox {
  65. rbox segbox copy pop    
  66. rbox urx get rbox ulx get sub
  67. flipRatio mul dup 
  68. segbox ulx get add segbox ulx 3 -1 roll put
  69. segbox llx get add segbox llx 3 -1 roll put
  70. } bind def
  71. %%EndProcSet
  72. %%BeginProcSet : drawslantramp
  73. /drawslantramp {
  74. segbox urx get segbox ulx get sub 3 div dup dup dup dup dup dup dup dup dup
  75. segbox ulx get add segbox urx 3 -1 roll put
  76. segbox llx get add segbox lrx 3 -1 roll put
  77. segbox aload pop
  78. 0 0 1 slantrampseg
  79. segbox astore pop
  80. segbox ulx get add segbox ulx 3 -1 roll put
  81. segbox llx get add segbox llx 3 -1 roll put
  82. segbox urx get add segbox urx 3 -1 roll put
  83. segbox lrx get add segbox lrx 3 -1 roll put
  84. segbox aload pop
  85. 1 1 2 slantrampseg
  86. segbox astore pop
  87. segbox ulx get add segbox ulx 3 -1 roll put
  88. segbox llx get add segbox llx 3 -1 roll put
  89. segbox urx get add segbox urx 3 -1 roll put
  90. segbox lrx get add segbox lrx 3 -1 roll put
  91. 2 2 3 slantrampseg
  92. }bind def
  93. %%EndProcSet
  94. %%BeginProcSet : tan
  95. /tan {
  96. dup sin exch cos div
  97. }bind def
  98. %%EndProcSet
  99. %%BeginProcSet : rampbox
  100. /rampbox {
  101. pbox top get dup rbox uly 3 -1 roll put rbox ury 3 -1 roll put
  102. pbox left get dup rbox ulx 3 -1 roll put rbox llx 3 -1 roll put
  103. pbox bottom get dup rbox lly 3 -1 roll put rbox lry 3 -1 roll put
  104. pbox right get dup rbox urx 3 -1 roll put rbox lrx 3 -1 roll put
  105. }bind def
  106. %%EndProcSet
  107. %%BeginProcSet : rampbox
  108. /LoadSegBox {
  109. 4 copy
  110. segbox llx 6 -1 roll put
  111. segbox lly 5 -1 roll put
  112. segbox lrx 4 -1 roll put
  113. segbox lry 6 -1 roll put
  114. segbox urx 5 -1 roll put
  115. segbox ury 3 -1 roll put
  116. segbox ulx 4 -1 roll put
  117. segbox uly 3 -1 roll put
  118. } bind def
  119. /TransToCenter {
  120. gsave
  121. flattenpath
  122. pathbbox
  123. grestore
  124. 2 index
  125. sub 2.0 div exch
  126. 3 index sub 2.0 div
  127. 4 -1 roll add
  128. 3 1 roll add
  129. translate
  130. } bind def
  131. /RotRampGrad {
  132. gsave
  133. TransToCenter
  134. -1.0 mul 180.0 add rotate
  135. flattenpath
  136. pathbbox 
  137. clip
  138. newpath
  139. LoadSegBox
  140. flipRatio 1 lt dup{flipramp}if flipRatio 0 gt and
  141. {
  142. /flipRatio 1.0 flipRatio sub def
  143. segbox rbox copy pop leftrbox drawslantramp flipramp rightrbox drawslantramp
  144. }
  145. {drawslantramp} ifelse
  146. grestore
  147. } bind def
  148. /bbg {
  149. pbox exch get
  150. } bind def
  151. %%BeginProcSet : DR
  152. /DR {        % Directional ramp
  153. /workingMatrix mstore def
  154. objectCord setmatrix
  155. flipramp
  156. gsave
  157. flattenpath pathbbox
  158. grestore
  159. pbox bottom 3 -1 roll put pbox right 3 -1 roll put pbox top 3 -1 roll put pbox left 3 -1 roll put
  160. rampAngle RotRampGrad
  161. RF
  162. workingMatrix setmatrix
  163. }bind def
  164. %%EndProcSet
  165. %%BeginProcSet : ramparc
  166. /ramparc {
  167. gsave
  168. circum rampdelta delta astore pop
  169. /rampPenW 60.0 nRampSteps div def
  170. /ang1 exch rampAngle sub def 
  171. /ang2 rampPenW ang1 add def 
  172. rampColors exch get aload mycurrentrgbcolor copy pop setrgbcolor 1 setlinewidth
  173. nRampSteps {ramparcseg}repeat
  174. grestore
  175. }bind def
  176. %%EndProcSet
  177. %%BeginProcSet : ramparcseg
  178. /ramparcseg {
  179. newpath
  180. rampcenter aload pop moveto
  181. rampcenter aload pop rampradius ang2 ang1 arcn fill
  182. /ang1 ang2 def 
  183. /ang2 ang2 rampPenW add def
  184. delta aload pop adddelta
  185. }bind def
  186. %%EndProcSet
  187. /GetRadius {
  188. rbox urx get rbox llx get sub 2 div rampcenter 0 get abs add dup mul
  189. rbox lly get rbox ury get sub 2 div rampcenter 1 get abs add dup mul
  190. add sqrt
  191. } bind def
  192. %%BeginProcSet : circularRamp
  193. /circularRamp {
  194. rampbox
  195. /rampradius GetRadius def
  196. CalcCrcm
  197. flipramp
  198. 0 0 0 1 ramparc
  199. 1 60 1 2 ramparc
  200. 2 120 2 3 ramparc
  201. flipramp
  202. 0 180 0 1 ramparc
  203. 1 240 1 2 ramparc
  204. 2 300 2 3 ramparc
  205. }bind def
  206. %%EndProcSet
  207. /GetCircumf {
  208. 2.0 mul 3.1415926 mul
  209. } bind def
  210. /CalcCrcm {
  211. rampradius GetCircumf
  212. /circum exch 6.0 div def
  213. } bind def
  214. %%BeginProcSet : CR
  215. /CR {
  216. gsave
  217. clip
  218. MTC currentmatrix pop
  219. CTM setmatrix
  220. flattenpath
  221. pathbbox pbox bottom 3 -1 roll put pbox right 3 -1 roll put pbox top 3 -1 roll put pbox left 3 -1 roll put
  222. pbox left get pbox right get sub abs 2 div 
  223. pbox left get add rampcenter 0 get add rampcenter 0 3 -1 roll put
  224. pbox top get pbox bottom get sub abs 2 div
  225. pbox top get add rampcenter 1 get add rampcenter 1 3 -1 roll put
  226. circularRamp
  227. MTC setmatrix
  228. grestore
  229. RF
  230. }bind def
  231. %%EndProcSet
  232. %%BeginProcSet : shaperamp
  233. /SBR {
  234. gsave
  235. clip
  236. /workingMatrix mstore def
  237. objectCord setmatrix
  238. flattenpath
  239. /BaseBox pathbbox 4 array astore def
  240. /len BaseBox 2 get BaseBox 0 get sub dup mul
  241. BaseBox 3 get BaseBox 1 get sub dup mul
  242. add sqrt
  243. 12.0 div
  244. def
  245. /EndBox
  246. BaseBox aload pop
  247. 3 -1 roll sub
  248. 3 1 roll
  249. exch sub
  250. /dbx exch def
  251. /dby exch def
  252. BaseBox aload pop pop pop
  253. /blly exch def
  254. /bllx exch def
  255. sbox 0 get 100.0 div dby mul blly add
  256. sbox 1 get 100.0 div dbx mul bllx add
  257. sbox 2 get 100.0 div dby mul blly add
  258. sbox 3 get 100.0 div dbx mul bllx add
  259. exch
  260. 4 -2 roll
  261. exch
  262. 4 -2 roll
  263. 4 array astore
  264. def
  265. BaseBox EndBox ShapeBurst
  266. workingMatrix setmatrix
  267. grestore
  268. } bind def
  269. %%EndProcSet
  270. /GetBoxCenter {
  271. 2 index
  272. sub 2.0 div
  273. 3 -1 roll add
  274. 3 1 roll
  275. 1 index sub
  276. 2.0 div add
  277. exch
  278. } bind def
  279. /GetInterBox {
  280. /boxInter exch def
  281. 4 1 7 {
  282. -1 roll
  283. 7 index
  284. } for
  285. sub boxInter mul
  286. 8 -1 roll add
  287. 7 1 roll
  288. sub boxInter mul
  289. 7 -1 roll add
  290. 6 1 roll
  291. sub boxInter mul
  292. 6 -1 roll add
  293. 5 1 roll
  294. sub boxInter mul
  295. 5 -1 roll add
  296. 4 1 roll
  297. } bind def
  298. /GetBoxCenterDeltas {
  299. GetBoxCenter
  300. 6 2 roll
  301. GetBoxCenter
  302. 3 -1 roll exch sub
  303. 3 1 roll sub
  304. exch
  305. } bind def
  306. /GetBoxCornerDeltas {
  307. pop pop
  308. 4 2 roll pop pop
  309. 3 -1 roll sub
  310. 3 1 roll exch sub
  311. exch
  312. } bind def
  313. %%BeginProcSet : getpath 
  314. /getpath {
  315. /k 0 def
  316. {/k k 1 add def pop pop}{/k k 1 add def pop pop}{/k k 1 add def pop pop pop pop pop pop}{}pathforall
  317. /pfa k array def
  318. /k 0 def
  319. {{moveto} 3 array astore pfa k 3 -1 roll put /k k 1 add def}
  320. {{lineto} 3 array astore pfa k 3 -1 roll put /k k 1 add def}
  321. {{curveto} 7 array astore pfa k 3 -1 roll put /k k 1 add def}
  322. {}pathforall
  323. }bind def
  324. %%EndProcSet
  325. /ShapeBurst {
  326. getpath
  327. newpath
  328. /SBERect exch 4 array copy def
  329. /SBBRect exch 4 array copy def
  330. /interRect1 SBBRect aload pop SBERect aload pop .3333333 GetInterBox 4 array astore def
  331. /interRect2 SBBRect aload pop SBERect aload pop .6666666 GetInterBox 4 array astore def
  332. 0 0 1 SBBRect interRect1 ShapeBurstSeg
  333. msave
  334. interRect1 0 get interRect1 1 get translate
  335. SBBRect aload pop interRect1 aload pop GetBoxesRatio scale
  336. SBBRect 0 get -1.0 mul SBBRect 1 get -1.0 mul translate
  337. 1 1 2 interRect1 interRect2 ShapeBurstSeg
  338. mrestore
  339. msave
  340. interRect2 0 get interRect2 1 get translate
  341. SBBRect aload pop interRect2 aload pop GetBoxesRatio scale
  342. SBBRect 0 get -1.0 mul SBBRect 1 get -1.0 mul translate
  343. 2 2 3 interRect2 SBERect ShapeBurstSeg
  344. mrestore
  345. } bind def
  346. /ShapeBurstSeg {
  347. /sbr1 exch 4 array copy def
  348. /sbr0 exch 4 array copy def
  349. /blx sbr0 0 get def
  350. /bly sbr0 1 get def
  351. len rampdelta delta astore pop
  352. sbr0 aload pop sbr1 aload pop GetBoxesRatio
  353. /ratioY exch def
  354. /ratioX exch def
  355. sbr0 aload pop sbr1 aload pop GetBoxCornerDeltas
  356. /dlly exch nRampSteps div def
  357. /dllx exch nRampSteps div def
  358. /scaleStepX 1.0 ratioX sub nRampSteps div def
  359. /scaleStepY 1.0 ratioY sub nRampSteps div def
  360. /currentScaleX 1.0 scaleStepX sub def
  361. /currentScaleY 1.0 scaleStepY sub def
  362. /translationX blx dllx add def
  363. /translationY bly dlly add def
  364. /currentScaleX 1.0  def
  365. /currentScaleY 1.0  def
  366. /translationX blx def
  367. /translationY bly def
  368. rampColors exch get aload mycurrentrgbcolor copy pop setrgbcolor
  369. nRampSteps {
  370. msave
  371. translationX translationY translate
  372. currentScaleX currentScaleY scale
  373. blx -1.0 mul bly -1.0 mul translate
  374. pfa {aload pop exec} forall fill
  375. delta aload pop adddelta
  376. /translationX translationX dllx add def
  377. /translationY translationY dlly add def
  378. /currentScaleX currentScaleX scaleStepX sub def
  379. /currentScaleY currentScaleY scaleStepY sub def
  380. mrestore
  381. } repeat
  382. msave
  383. translationX translationY translate
  384. currentScaleX currentScaleY scale
  385. blx -1.0 mul bly -1.0 mul translate
  386. pfa {aload pop exec} forall fill
  387. mrestore
  388. } bind def